File: /var/www/html/wpprotonperinggit/wp-content/plugins/rafflepress/public/js/iframeResizer.min.js
"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(f){if("undefined"!=typeof window){var e,l=0,m=!1,n=!1,v="message".length,I="[iFrameSizer]",x=I.length,F=null,r=window.requestAnimationFrame,g={max:1,scroll:1,bodyScroll:1,documentElementScroll:1},M={},t=null,h={autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){E("onMessage function not defined")},onResized:function(){},onScroll:function(){return!0}},k={};window.jQuery&&((e=window.jQuery).fn?e.fn.iFrameResize||(e.fn.iFrameResize=function(t){return this.filter("iframe").each(function(e,n){d(n,t)}).end()}):T("","Unable to bind to jQuery, it is not fully loaded.")),"function"==typeof define&&define.amd?define([],q):"object"===("undefined"==typeof module?"undefined":_typeof(module))&&"object"===_typeof(module.exports)&&(module.exports=q()),window.iFrameResize=window.iFrameResize||q()}function p(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function z(e,n,t){e.addEventListener(n,t,!1)}function O(e,n,t){e.removeEventListener(n,t,!1)}function o(e){return I+"["+(t="Host page: "+(n=e),window.top!==window.self&&(t=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+n:"Nested host page: "+n),t)+"]";var n,t}function i(e){return M[e]?M[e].log:m}function R(e,n){a("log",e,n,i(e))}function T(e,n){a("info",e,n,i(e))}function E(e,n){a("warn",e,n,!0)}function a(e,n,t,i){!0===i&&"object"===_typeof(window.console)&&console[e](o(n),t)}function s(n){function a(){e("Height"),e("Width"),A(function(){P(b),N(y),l("onResized",b)},b,"init")}function e(e){var n=Number(M[y]["max"+e]),t=Number(M[y]["min"+e]),i=e.toLowerCase(),o=Number(b[i]);R(y,"Checking "+i+" is in range "+t+"-"+n),o<t&&(o=t,R(y,"Set "+i+" to min value")),n<o&&(o=n,R(y,"Set "+i+" to max value")),b[i]=""+o}function s(e){return w.substr(w.indexOf(":")+v+e)}function d(t,i){var e,n,o;e=function(){var e,n;B("Send Page Info","pageInfo:"+(e=document.body.getBoundingClientRect(),n=b.iframe.getBoundingClientRect(),JSON.stringify({iframeHeight:n.height,iframeWidth:n.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(n.top-e.top,10),offsetLeft:parseInt(n.left-e.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})),t,i)},n=32,k[o=i]||(k[o]=setTimeout(function(){k[o]=null,e()},n))}function c(e){var n=e.getBoundingClientRect();return C(y),{x:Math.floor(Number(n.left)+Number(F.x)),y:Math.floor(Number(n.top)+Number(F.y))}}function u(e){var n=e?c(b.iframe):{x:0,y:0},t={x:Number(b.width)+n.x,y:Number(b.height)+n.y};R(y,"Reposition requested from iFrame (offset x:"+n.x+" y:"+n.y+")"),window.top!==window.self?window.parentIFrame?window.parentIFrame["scrollTo"+(e?"Offset":"")](t.x,t.y):E(y,"Unable to scroll to requested position, window.parentIFrame not found"):(F=t,f(),R(y,"--"))}function f(){!1!==l("onScroll",F)?N(y):H()}function l(e,n){return S(y,e,n)}var t,i,o,r,m,g,h,p,w=n.data,b={},y=null;"[iFrameResizerChild]Ready"===w?function(){for(var e in M)B("iFrame requested init",L(e),M[e].iframe,e)}():I===(""+w).substr(0,x)&&w.substr(x).split(":")[0]in M?(m=w.substr(x).split(":"),g=m[1]?parseInt(m[1],10):0,h=M[m[0]]&&M[m[0]].iframe,p=getComputedStyle(h),b={iframe:h,id:m[0],height:g+function(e){if("border-box"!==e.boxSizing)return 0;var n=e.paddingTop?parseInt(e.paddingTop,10):0,t=e.paddingBottom?parseInt(e.paddingBottom,10):0;return n+t}(p)+function(e){if("border-box"!==e.boxSizing)return 0;var n=e.borderTopWidth?parseInt(e.borderTopWidth,10):0,t=e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0;return n+t}(p),width:m[2],type:m[3]},y=b.id,M[y]&&(M[y].loaded=!0),(r=b.type in{true:1,false:1,undefined:1})&&R(y,"Ignoring init message from meta parent page"),!r&&(o=!0,M[i=y]||(o=!1,E(b.type+" No settings for "+i+". Message was: "+w)),o)&&(R(y,"Received: "+w),t=!0,null===b.iframe&&(E(y,"IFrame ("+b.id+") not found"),t=!1),t&&function(){var e,t=n.origin,i=M[y]&&M[y].checkOrigin;if(i&&""+t!="null"&&!(i.constructor===Array?function(){var e=0,n=!1;for(R(y,"Checking connection is from allowed list of origins: "+i);e<i.length;e++)if(i[e]===t){n=!0;break}return n}():(e=M[y]&&M[y].remoteHost,R(y,"Checking connection is from: "+e),t===e)))throw new Error("Unexpected message received from: "+t+" for "+b.iframe.id+". Message was: "+n.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}()&&function(){switch(M[y]&&M[y].firstRun&&M[y]&&(M[y].firstRun=!1),b.type){case"close":W(b.iframe);break;case"message":r=s(6),R(y,"onMessage passed: {iframe: "+b.iframe.id+", message: "+r+"}"),l("onMessage",{iframe:b.iframe,message:JSON.parse(r)}),R(y,"--");break;case"autoResize":M[y].autoResize=JSON.parse(s(9));break;case"scrollTo":u(!1);break;case"scrollToOffset":u(!0);break;case"pageInfo":d(M[y]&&M[y].iframe,y),function(){function e(n,t){function i(){M[r]?d(M[r].iframe,r):o()}["scroll","resize"].forEach(function(e){R(r,n+e+" listener for sendPageInfo"),t(window,e,i)})}function o(){e("Remove ",O)}var r=y;e("Add ",z),M[r]&&(M[r].stopPageInfo=o)}();break;case"pageInfoStop":M[y]&&M[y].stopPageInfo&&(M[y].stopPageInfo(),delete M[y].stopPageInfo);break;case"inPageLink":e=s(9),t=e.split("#")[1]||"",i=decodeURIComponent(t),(o=document.getElementById(i)||document.getElementsByName(i)[0])?(n=c(o),R(y,"Moving to in page link (#"+t+") at x: "+n.x+" y: "+n.y),F={x:n.x,y:n.y},f(),R(y,"--")):window.top!==window.self?window.parentIFrame?window.parentIFrame.moveToAnchor(t):R(y,"In page link #"+t+" not found and window.parentIFrame not found"):R(y,"In page link #"+t+" not found");break;case"reset":j(b);break;case"init":a(),l("onInit",b.iframe);break;default:a()}var e,n,t,i,o,r}())):T(y,"Ignored: "+w)}function S(e,n,t){var i=null,o=null;if(M[e]){if("function"!=typeof(i=M[e][n]))throw new TypeError(n+" on iFrame["+e+"] is not a function");o=i(t)}return o}function w(e){var n=e.id;delete M[n]}function W(e){var n=e.id;if(!1!==S(n,"onClose",n)){R(n,"Removing iFrame: "+n);try{e.parentNode&&e.parentNode.removeChild(e)}catch(e){E(e)}S(n,"onClosed",n),R(n,"--"),w(e)}else R(n,"Close iframe cancelled by onClose event")}function C(e){null===F&&R(e,"Get page position: "+(F={x:window.pageXOffset!==f?window.pageXOffset:document.documentElement.scrollLeft,y:window.pageYOffset!==f?window.pageYOffset:document.documentElement.scrollTop}).x+","+F.y)}function N(e){null!==F&&(window.scrollTo(F.x,F.y),R(e,"Set page position: "+F.x+","+F.y),H())}function H(){F=null}function j(e){R(e.id,"Size reset requested by "+("init"===e.type?"host page":"iFrame")),C(e.id),A(function(){P(e),B("reset","reset",e.iframe,e.id)},e,"reset")}function P(t){function i(e){n||"0"!==t[e]||(n=!0,R(o,"Hidden iFrame detected, creating visibility listener"),function(){function n(){Object.keys(M).forEach(function(e){!function(n){function e(e){return"0px"===(M[n]&&M[n].iframe.style[e])}M[n]&&(t=M[n].iframe,null!==t.offsetParent)&&(e("height")||e("width"))&&B("Visibility change","resize",M[n].iframe,n);var t}(e)})}function e(e){R("window","Mutation observed: "+e[0].target+" "+e[0].type),c(n,16)}var t=p();t&&(i=document.querySelector("body"),o={attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0},new t(e).observe(i,o));var i,o}())}function e(e){var n;n=e,t.id?(t.iframe.style[n]=t[n]+"px",R(t.id,"IFrame ("+o+") "+n+" set to "+t[n]+"px")):R("undefined","messageData id not set"),i(e)}var o=t.iframe.id;M[o]&&(M[o].sizeHeight&&e("height"),M[o].sizeWidth&&e("width"))}function A(e,n,t){t!==n.type&&r&&!window.jasmine?(R(n.id,"Requesting animation frame"),r(e)):e()}function B(e,n,t,i,o){var r,a=!1;i=i||t.id,M[i]&&(t&&"contentWindow"in t&&null!==t.contentWindow?(r=M[i]&&M[i].targetOrigin,R(i,"["+e+"] Sending msg to iframe["+i+"] ("+n+") targetOrigin: "+r),t.contentWindow.postMessage(I+n,r)):E(i,"["+e+"] IFrame("+i+") not found"),o&&M[i]&&M[i].warningTimeout&&(M[i].msgTimeout=setTimeout(function(){!M[i]||M[i].loaded||a||(a=!0,E(i,"IFrame has not responded within "+M[i].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))},M[i].warningTimeout)))}function L(e){return e+":"+M[e].bodyMarginV1+":"+M[e].sizeWidth+":"+M[e].log+":"+M[e].interval+":"+M[e].enablePublicMethods+":"+M[e].autoResize+":"+M[e].bodyMargin+":"+M[e].heightCalculationMethod+":"+M[e].bodyBackground+":"+M[e].bodyPadding+":"+M[e].tolerance+":"+M[e].inPageLinks+":"+M[e].resizeFrom+":"+M[e].widthCalculationMethod}function d(t,e){function n(e){var n=e.split("Callback");if(2===n.length){var t="on"+n[0].charAt(0).toUpperCase()+n[0].slice(1);this[t]=this[e],delete this[e],E(u,"Deprecated: '"+e+"' has been renamed '"+t+"'. The old method will be removed in the next major version.")}}var i,o,r,a,s,d,c,u=(""===(i=t.id)&&(t.id=(o=e&&e.id||h.id+l++,null!==document.getElementById(o)&&(o+=l++),i=o),m=(e||{}).log,R(i,"Added missing iframe ID: "+i+" ("+t.src+")")),i);u in M&&"iFrameResizer"in t?E(u,"Ignored iFrame, already setup."):(d=(d=e)||{},M[u]={firstRun:!0,iframe:t,remoteHost:t.src&&t.src.split("/").slice(0,3).join("/")},function(e){if("object"!==_typeof(e))throw new TypeError("Options is not an object")}(d),Object.keys(d).forEach(n,d),function(e){for(var n in h)Object.prototype.hasOwnProperty.call(h,n)&&(M[u][n]=Object.prototype.hasOwnProperty.call(e,n)?e[n]:h[n])}(d),M[u]&&(M[u].targetOrigin=!0===M[u].checkOrigin?""===(c=M[u].remoteHost)||null!==c.match(/^(about:blank|javascript:|file:\/\/)/)?"*":c:"*"),function(){switch(R(u,"IFrame scrolling "+(M[u]&&M[u].scrolling?"enabled":"disabled")+" for "+u),t.style.overflow=!1===(M[u]&&M[u].scrolling)?"hidden":"auto",M[u]&&M[u].scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=M[u]?M[u].scrolling:"no"}}(),function(){function e(e){1/0!==M[u][e]&&0!==M[u][e]&&(t.style[e]=M[u][e]+"px",R(u,"Set "+e+" = "+M[u][e]+"px"))}function n(e){if(M[u]["min"+e]>M[u]["max"+e])throw new Error("Value for min"+e+" can not be greater than max"+e)}n("Height"),n("Width"),e("maxHeight"),e("minHeight"),e("maxWidth"),e("minWidth")}(),"number"!=typeof(M[u]&&M[u].bodyMargin)&&"0"!==(M[u]&&M[u].bodyMargin)||(M[u].bodyMarginV1=M[u].bodyMargin,M[u].bodyMargin=M[u].bodyMargin+"px"),r=L(u),(s=p())&&(a=s,t.parentNode&&new a(function(e){e.forEach(function(e){Array.prototype.slice.call(e.removedNodes).forEach(function(e){e===t&&W(t)})})}).observe(t.parentNode,{childList:!0})),z(t,"load",function(){var e,n;B("iFrame.onload",r,t,f,!0),e=M[u]&&M[u].firstRun,n=M[u]&&M[u].heightCalculationMethod in g,!e&&n&&j({iframe:t,height:0,width:0,type:"init"})}),B("init",r,t,f,!0),M[u]&&(M[u].iframe.iFrameResizer={close:W.bind(null,M[u].iframe),removeListeners:w.bind(null,M[u].iframe),resize:B.bind(null,"Window resize","resize",M[u].iframe),moveToAnchor:function(e){B("Move to anchor","moveToAnchor:"+e,M[u].iframe,u)},sendMessage:function(e){B("Send Message","message:"+(e=JSON.stringify(e)),M[u].iframe,u)}}))}function c(e,n){null===t&&(t=setTimeout(function(){t=null,e()},n))}function u(){"hidden"!==document.visibilityState&&(R("document","Trigger event: Visiblity change"),c(function(){b("Tab Visable","resize")},16))}function b(t,i){Object.keys(M).forEach(function(e){var n;M[n=e]&&"parent"===M[n].resizeFrom&&M[n].autoResize&&!M[n].firstRun&&B(t,i,M[e].iframe,e)})}function y(){z(window,"message",s),z(window,"resize",function(){var e;R("window","Trigger event: "+(e="resize")),c(function(){b("Window "+e,"resize")},16)}),z(document,"visibilitychange",u),z(document,"-webkit-visibilitychange",u)}function q(){function i(e,n){n&&(!function(){if(!n.tagName)throw new TypeError("Object is not a valid DOM element");if("IFRAME"!==n.tagName.toUpperCase())throw new TypeError("Expected <IFRAME> tag, found <"+n.tagName+">")}(),d(n,e),o.push(n))}var o;return function(){var e,n=["moz","webkit","o","ms"];for(e=0;e<n.length&&!r;e+=1)r=window[n[e]+"RequestAnimationFrame"];r?r=r.bind(window):R("setup","RequestAnimationFrame not supported")}(),y(),function(e,n){var t;switch(o=[],(t=e)&&t.enablePublicMethods&&E("enablePublicMethods option has been removed, public methods are now always available in the iFrame"),_typeof(n)){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(n||"iframe"),i.bind(f,e));break;case"object":i(e,n);break;default:throw new TypeError("Unexpected data type ("+_typeof(n)+")")}return o}}}();